/* SPDX-License-Identifier: GPL-2.0 */

#ifndef EULEROS_DIM_CORE_MEASURE_H
#define EULEROS_DIM_CORE_MEASURE_H

#define DIM_INTERVAL_MAX 525600
#define DIM_INTERVAL_MIN 0

/**
 * dim_measure_all - do measure work, if no baseline, build baseline
 *
 * Return: 0 on success or errno on failure
 */
int dim_measure_all(void);

/**
 * dim_measure_baseline_build - build the baseline for measurement
 *
 * This function will do as follows:
 * 1. parse dim policy
 * 2. parse build static baseline
 * 3. init measure log
 * 4. build dynamic baseline
 *
 * Return: 0 on success or errno on failure
 */
int dim_measure_baseline_build(void);

/**
 * dim_measure_baseline_destroy - destroy measure baseline
 */
void dim_measure_baseline_destroy(void);

/**
 * dim_measure_timer_init - init periodic measurement timer
 *
 * Return: 0 on success or errno on failure
 */
int dim_measure_timer_init(void);

/**
 * dim_measure_timer_destroy - destroy periodic measurement timer
 */
void dim_measure_timer_destroy(void);

/**
 * dim_measure_timer_set_intervel - set timer interval
 *
 * @m: interval on minute
 *
 * Return: 0 on success or errno on failure
 */
int dim_measure_timer_set_intervel(unsigned long m);

/**
 * dim_periodic_measurement_get - get timer interval
 *
 * Return: interval on minute
 */
unsigned long dim_measure_timer_get_intervel(void);

/**
 * dim_measure_set_tampered_action - set tampered action
 *
 * @m: tampered action val
 *
 * Return: 0 on success or errno on failure
 */
int dim_measure_set_tampered_action(unsigned int m);

/**
 * dim_measure_get_tampered_action - get tampered action
 *
 * Return: tampered action val
 */
unsigned int dim_measure_get_tampered_action(void);

#endif /* EULEROS_DIM_CORE_MEASURE_H */
